package com.ujiuye.dao;

import com.ujiuye.domain.dto.SaveCategoryDTO;
import com.ujiuye.domain.po.Category;
import com.ujiuye.domain.vo.CategoryListVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ICategoryMapper {
    public List<Category> findAll();

    @Select("select * from category where id = #{id}")
    Category getById(int id);

    @Insert("insert into category (catname) values (#{catname})")
    void add(SaveCategoryDTO saveCategoryDTO);

    @Update("update category set catname = #{catname} where id = #{id}")
    void update(SaveCategoryDTO saveCategoryDTO);

    @Delete("delete from category where id = #{id}")
    void deleteById(int id);

    List<Category> pageQuery(@Param(value = "catname") String catname);
}
